package com.bocai.eelly.net;


import com.bocai.eelly.bean.BaseBean;
import com.bocai.eelly.bean.DialogBean;
import com.bocai.eelly.bean.FabricInquiryListBean;
import com.bocai.eelly.bean.FactoryListBean;
import com.bocai.eelly.bean.FindClothStockBean;
import com.bocai.eelly.bean.FindFabricListBean;
import com.bocai.eelly.bean.FindFabricStockBean;
import com.bocai.eelly.bean.FindFuliaoListBean;
import com.bocai.eelly.bean.FindFuliaoStockBean;
import com.bocai.eelly.bean.FindHuodaiListBean;
import com.bocai.eelly.bean.FindNewProductListBean;
import com.bocai.eelly.bean.FindToolsListBean;
import com.bocai.eelly.bean.FindToolsStockBean;
import com.bocai.eelly.bean.FuliaoInquiryListBean;
import com.bocai.eelly.bean.HistoryListBean;
import com.bocai.eelly.bean.HuodaiListBean;
import com.bocai.eelly.bean.LoginBean;
import com.bocai.eelly.bean.NewsBean;
import com.bocai.eelly.bean.OrderListBean;
import com.bocai.eelly.bean.PlaceBean;
import com.bocai.eelly.bean.PortBean;
import com.bocai.eelly.bean.RegistBean;

import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;
import rx.Observable;

/**
 * Created by admin on 2016/1/9.
 */
public interface Api {

    /**
     * 登录
     */
    @FormUrlEncoded
    @POST(Url.LOGINURL)
    Observable<LoginBean> login(
            @Field("timeline") String timeline ,@Field("sign") String sign  ,@Field("username") String username  ,@Field("pwd") String pwd  );

    /**
     * 获取验证码
     * @param phone
     * @return
     */
    @FormUrlEncoded
    @POST(Url.OBTAINCODEURL)
    Observable<BaseBean> getCode(
            @Field("timeline") String timeline ,@Field("sign") String sign  ,@Field("phone") String phone );

    /**
     * 获取忘记密码验证码
     * @param phone
     * @return
     */
    @FormUrlEncoded
    @POST(Url.FORGETPWDGETCODE)
    Observable<BaseBean> getForgetPwdCode(
            @Field("timeline") String timeline ,@Field("sign") String sign  ,@Field("phone") String phone );


    /**
     * 忘记密码
     * @param timeline
     * @param sign
     * @param phone
     * @param verify
     * @param pwd
     * @param rpwd
     * @return
     */
    @FormUrlEncoded
    @POST(Url.FORGETPWD)
    Observable<BaseBean> forgetPwd(@Field("timeline") String timeline ,@Field("sign") String sign  ,
                                   @Field("phone") String phone ,@Field("verify") String verify  ,@Field("pwd") String pwd  ,
                                   @Field("rpwd") String rpwd  );
    /**
     * 注册
     * @param username
     * @param pwd
     * @param rpwd
     * @param email
     * @param phone
     * @param verify
     * @return
     */
    @FormUrlEncoded
    @POST(Url.REGISTERURL)
    Observable<RegistBean> regist(@Field("timeline") String timeline , @Field("sign") String sign  ,
                                  @Field("username") String username , @Field("pwd") String pwd  , @Field("rpwd") String rpwd  ,
                                  @Field("email") String email, @Field("phone") String phone  , @Field("verify") String verify  );

    /**
     * 注册时的完善资料
     * @param timeline
     * @param sign
     * @param userid
     * @param company
     * @param address
     * @param field
     * @param connect
     * @param product
     * @return
     */
    @FormUrlEncoded
    @POST(Url.REGIST_PERFECT_INFORMATION)
    Observable<BaseBean> registPerfectInformation(@Field("timeline") String timeline ,@Field("sign") String sign  ,
                                                  @Field("userid") String userid ,@Field("company") String company  ,@Field("address") String address ,
                                                  @Field("field") String field,@Field("connect") String connect  ,@Field("product") String product  );

    /**
     * 获取面料库存列表
     * @param timeline
     * @param sign
     * @param userid
     * @param page
     * @param pageSize
     * @param keyword
     * @return
     */
    @FormUrlEncoded
    @POST(Url.FINDMIANLIAOSTOCK)
    Observable<FindFabricStockBean> findMianliaoStock(@Field("timeline") String timeline , @Field("sign") String sign  ,
                                                      @Field("userid") String userid , @Field("page") int page  , @Field("pageSize") int pageSize  ,
                                                      @Field("keyword") String keyword);

    /**
     * 获取辅料库存列表
     * @param timeline
     * @param sign
     * @param userid
     * @param page
     * @param pageSize
     * @param keyword
     * @return
     */
    @FormUrlEncoded
    @POST(Url.FINDFULIAOSTOCK)
    Observable<FindFuliaoStockBean> findFuliaoStock(@Field("timeline") String timeline , @Field("sign") String sign  ,
                                                    @Field("userid") String userid , @Field("page") int page  , @Field("pageSize") int pageSize  ,
                                                    @Field("keyword") String keyword);

    /**
     * 获取服装库存列表
     * @param timeline
     * @param sign
     * @param userid
     * @param page
     * @param pageSize
     * @param keyword
     * @return
     */
    @FormUrlEncoded
    @POST(Url.FINDCLOTHSTOCK)
    Observable<FindClothStockBean> findClothStock(@Field("timeline") String timeline , @Field("sign") String sign  ,
                                                  @Field("userid") String userid , @Field("page") int page  , @Field("pageSize") int pageSize  ,
                                                  @Field("keyword") String keyword);

    /**
     * 获取工具库存列表
     * @param timeline
     * @param sign
     * @param userid
     * @param page
     * @param pageSize
     * @param keyword
     * @return
     */
    @FormUrlEncoded
    @POST(Url.FINDTOOLSSTOCK)
    Observable<FindToolsStockBean> findToolsStock(@Field("timeline") String timeline , @Field("sign") String sign  ,
                                                  @Field("userid") String userid , @Field("page") int page  , @Field("pageSize") int pageSize  ,
                                                  @Field("keyword") String keyword);

    /**
     * 找面料
     * @param timeline
     * @param sign
     * @param userid
     * @param page
     * @param pageSize
     * @param keyword
     * @return
     */
    @FormUrlEncoded
    @POST(Url.FINDFABRIC)
    Observable<FindFabricListBean> findFabric(@Field("timeline") String timeline , @Field("sign") String sign  ,
                                              @Field("userid") String userid , @Field("page") int page  , @Field("pageSize") int pageSize  ,
                                              @Field("keyword") String keyword, @Field("province") String  province  ,
                                              @Field("city") String city);

    /**
     * 找辅料
     * @param timeline
     * @param sign
     * @param userid
     * @param page
     * @param pageSize
     * @param keyword
     * @return
     */
    @FormUrlEncoded
    @POST(Url.FINDFULIAO)
    Observable<FindFuliaoListBean> findFuliao(@Field("timeline") String timeline , @Field("sign") String sign  ,
                                              @Field("userid") String userid , @Field("page") int page  , @Field("pageSize") int pageSize  ,
                                              @Field("keyword") String keyword, @Field("province") String  province  ,
                                              @Field("city") String city);

    /**
     * 找货代
     * @param timeline
     * @param sign
     * @param userid
     * @param page
     * @param pageSize
     * @param keyword
     * @return
     */
    @FormUrlEncoded
    @POST(Url.FINDHUODAI)
    Observable<FindHuodaiListBean> findHuodai(@Field("timeline") String timeline , @Field("sign") String sign  ,
                                              @Field("userid") String userid , @Field("page") int page  , @Field("pageSize") int pageSize  ,
                                              @Field("keyword") String keyword,@Field("destination_country") String destination_country);

    /**
     * 找工具设备
     * @param timeline
     * @param sign
     * @param userid
     * @param page
     * @param pageSize
     * @param keyword
     * @return
     */
    @FormUrlEncoded
    @POST(Url.FINDTOOLS)
    Observable<FindToolsListBean> findTools(@Field("timeline") String timeline , @Field("sign") String sign  ,
                                            @Field("userid") String userid , @Field("page") int page  , @Field("pageSize") int pageSize  ,
                                            @Field("keyword") String keyword, @Field("province") String  province  ,
                                            @Field("city") String city);

    /**
     * 找新品
     * @param timeline
     * @param sign
     * @param userid
     * @param page
     * @param pageSize
     * @param keyword
     * @return
     */
    @FormUrlEncoded
    @POST(Url.FINDNEWPRODUCT)
    Observable<FindNewProductListBean> findNewProduct(@Field("timeline") String timeline , @Field("sign") String sign  ,
                                                      @Field("userid") String userid , @Field("page") int page  , @Field("pageSize") int pageSize  ,
                                                      @Field("keyword") String keyword, @Field("province") String  province  ,
                                                      @Field("city") String city);



    /**
     * 获取工厂列表页
     * @param timeline
     * @param sign
     * @param userid
     * @param style
     * @param province
     * @param city
     * @param page
     * @param per
     * @return
     */
    @FormUrlEncoded
    @POST(Url.GETFACTORYLIST)
    Observable<FactoryListBean> getFactoryList(@Field("timeline") String timeline , @Field("sign") String sign  ,
                                               @Field("userid") String userid , @Field("style") String style ,
                                               @Field("province") String province , @Field("city") String city ,
                                               @Field("page") String page  , @Field("per") String per );

    /**
     * 获取订单列表页
     * @param timeline
     * @param sign
     * @param userid
     * @param style
     * @param province
     * @param city
     * @param page
     * @param per
     * @return
     */
    @FormUrlEncoded
    @POST(Url.GETORDERLIST)
    Observable<OrderListBean> getOrderList(@Field("timeline") String timeline , @Field("sign") String sign  ,
                                           @Field("userid") String userid , @Field("style") String style ,
                                           @Field("province") String province , @Field("city") String city ,
                                           @Field("page") String page  , @Field("per") String per );

    /**
     * 获取历史列表
     * @param timeline
     * @param sign
     * @param userid
     * @param page
     * @param pageSize
     * @return
     */
    @FormUrlEncoded
    @POST(Url.GETHISTORYLIST)
    Observable<HistoryListBean> getHistoryList(@Field("timeline") String timeline , @Field("sign") String sign  ,
                                               @Field("userid") String userid ,@Field("page") int page,@Field("pageSize") int pageSize);

    /**
     * 获取地区列表
     * @param timeline
     * @param sign
     * @param userid
     * @return
     */
    @FormUrlEncoded
    @POST(Url.GETPLACE)
    Observable<PlaceBean> getPlace(@Field("timeline") String timeline , @Field("sign") String sign  ,
                                   @Field("userid") String userid );

    /**
     * 获取面料类别
     */
    @FormUrlEncoded
    @POST(Url.GETFABCIRTYPE)
    Observable<DialogBean> getFabcirType(@Field("timeline") String timeline , @Field("sign") String sign  ,
                                         @Field("userid") String userid );

    /**
     * 获取品牌
     * @param timeline
     * @param sign
     * @param userid
     * @return
     */
    @FormUrlEncoded
    @POST(Url.GETBRAND)
    Observable<DialogBean> getBrand(@Field("timeline") String timeline , @Field("sign") String sign  ,
                                    @Field("userid") String userid );


    /**
     * 获取用途
     * @param timeline
     * @param sign
     * @param userid
     * @return
     */
    @FormUrlEncoded
    @POST(Url.GETPURPOSE)
    Observable<DialogBean> getPurpose(@Field("timeline") String timeline , @Field("sign") String sign  ,
                                      @Field("userid") String userid );

    /**
     * 获取运输方式
     * @param timeline
     * @param sign
     * @param userid
     * @return
     */
    @FormUrlEncoded
    @POST(Url.GETTRANSPORTMODE)
    Observable<DialogBean> getTransportMode(@Field("timeline") String timeline , @Field("sign") String sign  ,
                                            @Field("userid") String userid );

    /**
     * 获取贸易方式
     * @param timeline
     * @param sign
     * @param userid
     * @return
     */
    @FormUrlEncoded
    @POST(Url.GETTRADEMODE)
    Observable<DialogBean> getTradeMode(@Field("timeline") String timeline , @Field("sign") String sign  ,
                                        @Field("userid") String userid );

    /**
     *获取贸易术语
     * @param timeline
     * @param sign
     * @param userid
     * @return
     */
    @FormUrlEncoded
    @POST(Url.GET_MOYI_SHUYU)
    Observable<DialogBean> getMaoyiShuyu(@Field("timeline") String timeline , @Field("sign") String sign  ,
                                         @Field("userid") String userid );

    /**
     *获取装箱方式
     * @param timeline
     * @param sign
     * @param userid
     * @return
     */
    @FormUrlEncoded
    @POST(Url.GET_ZHUANGXIANG_MODE)
    Observable<DialogBean> getZhuangxiangMode(@Field("timeline") String timeline , @Field("sign") String sign  ,
                                              @Field("userid") String userid );

    /**
     *获取付运费方
     * @param timeline
     * @param sign
     * @param userid
     * @return
     */
    @FormUrlEncoded
    @POST(Url.GET_PAY_FRIEIGHT)
    Observable<DialogBean> GETPayFrieight(@Field("timeline") String timeline , @Field("sign") String sign  ,
                                          @Field("userid") String userid );

    /**
     * 获取库存服装款式选项
     * @param timeline
     * @param sign
     * @param userid
     * @return
     */
    @FormUrlEncoded
    @POST(Url.GET_CLOTH_STOCK_STYLE)
    Observable<DialogBean> getClothStockTypes(@Field("timeline") String timeline , @Field("sign") String sign  ,

                                          @Field("userid") String userid );

    /**
     * 获取库存面料种类
     * @param timeline
     * @param sign
     * @param userid
     * @return
     */
    @FormUrlEncoded
    @POST(Url.GET_FABRIC_STOCK_STYLE)
    Observable<DialogBean> getFabricStockTypes(@Field("timeline") String timeline , @Field("sign") String sign  ,
                                          @Field("userid") String userid );

    /**
     * 获取国家和港口
     * @param timeline
     * @param sign
     * @param userid
     * @return
     */
    @FormUrlEncoded
    @POST(Url.GET_DESTINATION)
    Observable<PortBean> getDestionation(@Field("timeline") String timeline , @Field("sign") String sign  ,
                                         @Field("userid") String userid );

    /**
     * 获取资讯列表
     * @param timeline
     * @param sign
     * @param userid
     * @param page
     * @param per
     * @return
     */
    @FormUrlEncoded
    @POST(Url.GET_NEWS_LIST)
    Observable<NewsBean> getNewsList(@Field("timeline") String timeline , @Field("sign") String sign  ,
                                     @Field("userid") String userid, @Field("page") String page  ,
                                     @Field("per") String per );


    /**
     * 获取货代询价列表
     * @param timeline
     * @param sign
     * @param userid
     * @param name
     * @param province
     * @param city
     * @param page
     * @param per
     * @return
     */
    @FormUrlEncoded
    @POST(Url.GET_HUODAI_XUNJIA)
    Observable<HuodaiListBean> getHuodaiXunjia(@Field("timeline") String timeline , @Field("sign") String sign  ,
                                               @Field("userid") String userid, @Field("name") String name   ,
                                               @Field("province") String province, @Field("city") String city  ,
                                               @Field("page") String page , @Field("per") String per);

    /**
     * 获取面料询价列表
     * @param timeline
     * @param sign
     * @param userid
     * @param name
     * @param province
     * @param city
     * @param page
     * @param per
     * @return
     */
    @FormUrlEncoded
    @POST(Url.GET_FABRIC_INQUIRY)
    Observable<FabricInquiryListBean> getFabricInquiry(@Field("timeline") String timeline , @Field("sign") String sign  ,
                                                       @Field("userid") String userid, @Field("name") String name   ,
                                                       @Field("province") String province, @Field("city") String city  ,
                                                       @Field("page") String page , @Field("per") String per);

    /**
     * 获取辅料询价列表
     * @param timeline
     * @param sign
     * @param userid
     * @param name
     * @param province
     * @param city
     * @param page
     * @param per
     * @return
     */
    @FormUrlEncoded
    @POST(Url.GET_FULIAO_INQUIRY)
    Observable<FuliaoInquiryListBean> getFuliaoInquiry(@Field("timeline") String timeline , @Field("sign") String sign  ,
                                                       @Field("userid") String userid, @Field("name") String name   ,
                                                       @Field("province") String province, @Field("city") String city  ,
                                                       @Field("page") String page , @Field("per") String per);

    /**
     * 用户反馈
     * @param timeline
     * @param sign
     * @param userid
     * @param content
     * @return
     */
    @FormUrlEncoded
    @POST(Url.FEEDBACK)
    Observable<BaseBean> feedback(@Field("timeline") String timeline , @Field("sign") String sign  ,
                                                       @Field("userid") String userid, @Field("content") String content );


}
